local nya__beige = fk.CreateSkill {

  name = "nya__beige",

  tags = {  },

}



nya__beige:addEffect(fk.Damaged, {
  name = "nya__beige",
  anim_type = "masochism",
  events = {fk.Damaged},
  can_trigger = function(self, event, target, player, data)
    return player:hasSkill(nya__beige.name) and data.card and data.card.trueName == "slash" and not data.to.dead and not player:isNude()
  end,
  on_cost = function(self, event, target, player, data)
    local card = player.room:askForDiscard(player, 1, 1, true, nya__beige.name, true, ".", "#nya__beige-invoke::"..target.id, true)
    if #card > 0 then
      event:setCostData(self, card)
      return true
    end
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    local suit = Fk:getCardById(event:getCostData(self)[1]):getSuitString()
    room:throwCard(event:getCostData(self), nya__beige.name, player, player)
    NyaBeige(player, target, data.from, suit)
    if not player.dead and not player:hasSkill("nya__play", true) then
      local all_choices = {"Cancel", "nya__beige1", "nya__beige2", "nya__beige3", "nya__beige4"}
      local choices = table.simpleClone(all_choices)
      if target.dead then
        table.removeOne(choices, "nya__beige1")
        table.removeOne(choices, "nya__beige2")
      elseif not target:isWounded() then
        table.removeOne(choices, "nya__beige1")
      end
      if not data.from or data.from.dead then
        table.removeOne(choices, "nya__beige3")
        table.removeOne(choices, "nya__beige4")
      elseif data.from:isNude() then
        table.removeOne(choices, "nya__beige3")
      end
      local choice = room:askForChoice(player, choices, nya__beige.name, "#nya__beige-choice::"..target.id, false, all_choices)
      if choice ~= "Cancel" then
        local suits = {"", "heart", "diamond", "club", "spade"}
        suit = suits[table.indexOf(all_choices, choice)]
        NyaBeige(player, target, data.from, suit)
      end
    end
  end,
})

return nya__beige